home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 158 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.9 KB  |  45 lines

  1. Newsgroups: comp.std.c
  2. Path: phcoms4.seri.philips.nl!panther!baynes
  3. From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes)
  4. Subject: Re: atexit() and return from main()
  5. Sender: news@ukpsshp1.serigate.philips.nl (account for localnews)
  6. Message-ID: <DLKrx7.6p6@ukpsshp1.serigate.philips.nl>
  7. Date: Mon, 22 Jan 1996 09:05:31 GMT
  8. References: <4dhfja$j50@fg70.rz.uni-karlsruhe.de> <4diicg$i9e@lyra.csx.cam.ac.uk> <TANMOY.96Jan18084025@qcd.lanl.gov>
  9. Organization: Philips Semiconductors, Southampton, UK
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
  13. : --text follows this line--
  14. : In article <4dkvjk$6q5@lyra.csx.cam.ac.uk> nmm1@cus.cam.ac.uk (Nick
  15. : Maclaren) writes: 
  16. :    However, for the advanced paper, think about the following problems:
  17. <snip>
  18. :    main() calls setjmp() and then calls exit().  An atexit() function
  19. :    calls longjmp() and returns to main().  This repeats (or does it?)
  20.  
  21. : Neither of these is permitted in any sense that I understand!
  22. : 7.10.4.3: If more than one call to the exit function is executed by
  23. : a program, the behaviour is undefined. No `permission by omission'
  24. : that I can see.
  25.  
  26. In this example what happens if no second call to exit is been made (after
  27. longjumping back to main the program does not attempt to call exit again -
  28. instead it keeps executing indefinately)?
  29.  
  30. Does a return from main count as a call to exit for the purposes of the
  31. one call restriction in 7.10.4.3? I assume it does because it is regarded
  32. as equivalent.
  33.  
  34. What happens if an atexit function calls atexit ? If you interpret the
  35. standard strictly I think the program has to enter a timewarp back to the
  36. call to exit and start with the just registered atexit function!
  37.  
  38.  
  39.  
  40. --
  41. Stephen Baynes                              baynes@mulsoc2.serigate.philips.nl
  42. Philips Semiconductors Ltd
  43. Southampton                                 My views are my own.
  44. United Kingdom
  45.